import json

res_dict = open("atom_res_dict.json")

res_dict_plus = open("atom_res_dict_plus.json")

merge_res_dict = open("merge_res_dict.json", 'w')

for res, res_plus in zip(res_dict, res_dict_plus):
    res_obj = json.loads(res)
    res_plus_obj = json.loads(res_plus)
    assert res_obj["index"] == res_plus_obj["index"]
    if "借款事件" in res_obj["atom"].keys():
        res_obj["atom"]["借款事件"]["实际还款时间"] = res_plus_obj["atom"]["借款事件"]["实际还款时间"]
        res_obj["atom"]["借款事件"]["实际还款金额"] = res_plus_obj["atom"]["借款事件"]["实际还款金额"]
    merge_res_dict.write(json.dumps(res_obj, ensure_ascii=False) + '\n')